<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>登录</title>
        <link rel="stylesheet" href="{S_URL}/templates/cms/css/Global.css" />
        <style>
            body {
                min-width: 1200px;
            }
            .top {
                width: 1200px;
                height: 46px;
                padding: 20px 0 20px 0;
            }
            .top a {
                float: left;
                width: 120px;
                height: 46px;
            }
            .top a img {
                width: 100%;
                height: 100%;
            }
            .top em {
                float: right;
                height: 46px;
                line-height: 46px;
                font-size: 18px;
            }
            .login {
                background: #bc4f52;
            }
            .cont {
                width: 1100px;
                height: 380px;
                padding-top: 60px;
                overflow: hidden;
            } 
            .cont_left {
                float: left;
                width: 540px;
            }
            .cont_left img {
                width: 100%;
                height: 100%;
            }
            .cont_right {
                float: right;
                width: 260px;
                height: 280px;
                background: #fff;
                padding: 10px 20px;
            }
            .login_top {
                height: 50px;
                line-height: 50px;
                font-size: 16px;
                text-align: center;
                border-bottom: #bc4f52 solid 2px;
            }
            .login_cont {
                padding-top: 26px;
            }
            .login_cont p {
                padding-top: 20px;
            }
            .login_cont p input {
                height: 32px;
                width: 100%;
                border: #eee solid 1px;
                padding: 0 10px;
            }
            .login_cont p input[type="submit"]{
                background: #bc4f52;
                cursor: pointer;
                font-size: 15px;
                color:#fff;
            }
            .login_cont p input[type="text"] {
                background: url({S_URL}/templates/cms/img/icon_user1.png) no-repeat 14px center / 16px 16px;
                padding:0 10px 0 36px;
            }
            .login_cont p input[type="password"] {
                background: url({S_URL}/templates/cms/img/icon_lock.png) no-repeat 14px center / 16px 16px;
                padding:0 10px 0 36px;
            }
        </style>
    </head>
    <body>
        <div class="top">
            <a href="javascript:void(0)"><img src="{S_URL}/templates/cms/img/logo.png"></a>
            <em>家捷送后台管理系统</em>
        </div>
        <div class="login">
            <div class="cont">
                <div class="cont_left"><img src="{S_URL}/templates/cms/img/cont_left.png"></div>
                <div class="cont_right">
                    <div class="login_top">欢迎来到家捷送！</div>
                    <div class="login_cont">
                        <form method="post" id="agent_login" name="login" action="{CPURL}" >
                            <input type="hidden" name="formhash" value="<!--{eval echo formhash();}-->" />
                            <p><input type="text" placeholder="请输入用户名" id="username" name="username" class="phonecode"></p>
                            <span id="checkusername" class="warning"></span>
                            <p><input type="password" placeholder="请输入密码" id="admin_password" name="password"></p>
                            <span id="checkpassword" class="warning"></span>
                            <p><input type="submit" value="登录" name="dologinbtn" class="actLogin" onclick="return  checklogin(this.form);"></p>
                            <input type="hidden" name="loginsubmit" value="true" />
                            <input type="hidden" name="dologin" value="yes" />
                        </form>
                    </div>
                </div>
            </div>
        </div>
        <div class="footer">
            <p></p>
            <p></p>
            <p></p>
        </div>
    </body>
    <script src="{S_URL}/templates/cms/js/jquery.js"></script>
    <script>
    $('username').focus();

    function checklogin(form){
        var username = $('username').value;
        var pwd = $('password').value;
        var phonenumFlg = true;
        var pwdFlg = true;

        if(form.username.value == null || form.username.value == ""){
            $('#checkusername').empty();
            $('#checkusername').append('<img src="images/base/check_error.gif" width="13" height="13"> &nbsp; 账号不能为空！');
            $('#checkusername').addClass("warning");
            phonenumFlg = false;
            return phonenumFlg;
        }else{
            $('#checkusername').empty();
            $('#checkusername').append('<img src="images/base/check_right.gif" width="13" height="13">');
            $('#checkusername').addClass("warning");
        }



        if(form.password.value == null || form.password.value == ""){
            $('#checkpassword').empty();
            $('#checkpassword').append('<img src="images/base/check_error.gif" width="13" height="13"> &nbsp; 密码不能为空!');
            $('#checkpassword').addClass("warning");
            pwdFlg = false;
            return pwdFlg;
        }else{
            $('checkpassword').empty();
            $('checkpassword').append('<img src="images/base/check_right.gif" width="13" height="13">');
            $('checkpassword').addClass("warning");
        }


        if(phonenumFlg == true && pwdFlg == true){
            //  ajaxpost('registerform', 'register');
            $('#agent_login').submit();
        }

    }


    var login_count = "{$login_count}";
    if(login_count > 2){
        var surl = $('surl').value;

        var html = '<label></label>' +
                '<input type="text" id="login_code" name="login_code" style="width:180px; height: 45px; padding:0px; text-align:center;" placeholder="请输入右侧验证码" validate="" validatename="密码">' +
                '<img id="code" src="/captcha" alt="看不清楚，换一张" style="cursor: pointer; vertical-align:middle; margin-left:15px; width:95px; height:45px;" onclick="create_code(\''+surl+'\');"/>' +
                '<span id="checkpassword" class="warning" style="height:20px; line-height:20px;"></span>';

        document.getElementById("addcode").innerHTML = html;
    }

    function create_code(surl){
        document.getElementById('code').src = '/captcha/'+Math.random()*10000;
    }
    </script>
</html>
